package com.hxkj.controller;

import com.hxkj.domain.po.UserBlacklist;
import com.hxkj.service.UserBlacklistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.concurrent.Callable;

@RestController
@RequestMapping(value = "/userBlacklist")
public class UserBlacklistController {

    @Autowired
    private UserBlacklistService userBlacklistService;

    @RequestMapping(value = "/addBlacklist")
    public void addBlacklist(UserBlacklist userBlacklist) throws Exception{
        userBlacklistService.addBlacklist(userBlacklist);
    }

    @RequestMapping(value = "/removeBlacklist")
    public void removeBlacklist(UserBlacklist userBlacklist) throws Exception{
        userBlacklistService.removeBlacklist(userBlacklist);
    }

    @RequestMapping(value = "/getList")
    public Callable<List<UserBlacklist>> getList(UserBlacklist userBlacklist) throws Exception{
        return () -> userBlacklistService.getList(userBlacklist);
    }
}
